﻿using DataAccess.Entities;
using FluentNHibernate.Mapping;

namespace DataAccess.Mappings
{
    public class CommentMap : ClassMap<Comment>
    {
        public CommentMap()
        {
            Id(x => x.Id);
            Map(x => x.Content);
            Map(x => x.DateCreated);
            References(x => x.Owner);
            HasManyToMany(x => x.DiscussionComments).Cascade.All().Inverse().Table("DiscussionComments");
            HasManyToMany(x => x.MediaComments).Cascade.All().Inverse().Table("MediaComments");
        }
    }
}
